The present invention relates to a microcomputer, such as a single-chip microcomputer with a built-in read-only memory.
A conventional single-chip microcomputer comprises a central processing unit (CPU) including a control unit, an operation unit and a register section, a memory device including a read-only memory (ROM) incapable of re-writing (reprogramming) and a random access memory (RAM) capable of writing and reading, and an input/output (I/O) device, which are all built in an IC chip.
The data processing speed of a microcomputer of this kind is increased year by year, and the minimum instruction execution time is about 1 microsecond in a 4-bit microcomputer, and about 500 nanoseconds in an 8-bit microcomputer. The circuit within a microcomputer is becoming more and more complicated, and accordingly, testing the functioning of the circuit is becoming more and more difficult.
In a conventional test, an external memory in which a test program has been written, is connected to the microcomputer through various terminals. The test mode is set using a control terminal. In this mode, address signals are outputted through input/output terminals and supplied to the external memory, and the test program is read out of the external memory and inputted through other input/output terminals to the microcomputer, and is executed. The test of the internal logic circuits is thereby accomplished.
The above-described microcomputer has the following problems.
When a function test of the microcomputer is conducted, time for outputting the address signals to access the external memory, and time for reading the test program out of the external memory are necessary, so that the execution of the test program is slower than the execution of the instructions of the internal ROM. As a result, it is impossible or very difficult to conduct the test under the same condition as where the internal ROM is operated at the maximum instruction execution speed. The reliability of the test is therefore not sufficient. Moreover, a large number of terminals are required for input/output of the addresses and the instructions. Another shortcoming of the conventional microcomputer is the incapacity of programming after manufacture. To generalize, the conventional microcomputer is not versatile enough for certain applications.